﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Data;
using QUANLYCHAMCONG.DAO.Core;
using ModuleDALCore;
using QUANLYCHAMCONG.BL.Entities;
using QUANLYCHAMCONG.BL.Entities.Import;

namespace QUANLYCHAMCONG.DAO.DAO.Import
{
    public class NHANVIENDAO:DALBase
    {
        
         private string _SpName;
        public string SpName
        {
            get { return "SpIMPORTNHANVIEN"; }
            set { _SpName = value; }
        }
        public NHANVIENDAO()
        {
            OpenConnect();
        }
        public bool Insert(NHANVIEN nv)
        {
            try
            {
                return (DBManager.Intance.ExecuteNonQuery(SpName, ConvertClassToArray.GetParamName(nv, null), ConvertClassToArray.GetValues(nv,1)) == 1);
            }
            catch
            {
                return false;
            }
        }
        public DataTable CheckStaffExists(NHANVIEN nv)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(nv, null), ConvertClassToArray.GetValues(nv, 0));
            }
            catch
            {
                return null;
            }
        }
    }
}
